<?php
class Core_model extends Model {
	protected $_table = '';
	public function __construct() {
		parent::Model();
	}

	public function create($data) {
		$data['`create`'] = date("Y-m-d H:i:s");
		$data['`update`'] = $data['`create`'];
		return $this->db->insert($this->_table,$data);
	}

	public function updated($data,$id) {
		$data['`updated`'] = date("Y-m-d H:i:s");
		return $this->db->update($this->_table,$data,"id=".$id);
	}

	public function retriveby($search=array(),$orderby = '',$limit = '') {
		return $this->db->get($this->_table)->result_array();
	}

	public function listfields($table) {
		return $this->db->list_fields($table);
	}
}
?>